home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-serious-
/
misc
/
srename
/
docs
/
srename.doc
< prev
next >
Wrap
Text File
|
1999-07-12
|
60KB
|
1,636 lines
*******************************************************************************
SRENAME 2.900 USERS MANUAL
Copyright (C) 1996-1999 Constantinos Nicolakakis
*******************************************************************************
INTRODUCTION :
The philosophy behind SRename is to give you a CLI command with relatively few,
but versatile functions that can be combined in many ways to provide whatever
renaming operation is needed by the user, rather than providing dozens of
specialised renaming options that limit the renaming operations that can be
performed, to what the programmer had in mind when he was designing the command
and are difficult to remember by the user.
SRename can easily replace the original Rename command but I wouldn't recommend
that because SRename's behaviour is not identical to the original command.
You will probably find SRename most useful at renaming a lot of filenames at
once, as it supports wildcards, multiple filenames and recursion.
Some of SRename's advantages:
* Selector-Action keyword separation that allows building specialized
functions easily.
* Total control over recursion.
* Wildcard and multiple filename support.
* Optional wildcard for directory selection in recursion.
* Can isolate selected parts of the filename for modification with the use
of the selector keywords.
* Executes multiple actions in one go.
* Performs intelligent renumbering with automatic checking for filename
clashes.
* Supports long filenames on filesystems that allow them.
* Can also modify filename comments.
* It's free.
PROGRAM STATUS :
SRename is freeware. Permission is granted to distribute free of charge,
in unchanged form, provided this documentation file is accompanied with the
program.
Permission is granted to include on freely distributable software libraries
such as Aminet CD-ROMs.
The author's permission is required if SRename is to be distributed as a part
of a commercial application.
Although I'm quite confident that SRename contains no major bugs, I can't
guarantee that it is completely bug-free, and do not accept any responsibility
of any damage this program could cause directly or indirectly.
REQUIREMENTS :
Amiga with kickstart 2 or higher.
TECHNICAL :
SRename is written in C++ and was compiled with SAS C 6.58. It uses C++
features like object classes to achieve code reusability, memory management
reliability and good program design.
Memory is allocated dynamically in pages, to avoid high memory usage.
Average memory usage is around 100-200 Kb when recursing through large disks
or partitions.
It always uses buffers when renaming more than one filename as the Ram-Disk's
filesystem has a bug that makes unbuffered renaming with pattern matching
problematic.
SRename has been tested successfully with Enforcer and MungWall on my A4000
060 @50 / 604e @200, kickstart 3.0, 72 MB RAM.
INSTALLATION :
Just copy SRename to your C: directory.
INTERFACE CHANGES/ADDITIONS :
The command interface of SRename is not 100% backwards compatible with previous
versions, as some functions have been replaced by others along the way, and
some improvements have been made to the command interface itself to make it
more consistent and easier to use.
To make it easier to upgrade to newer versions I include a button bank and
a start menu for use with Directory Opus 5, that is set up to work with the
latest version of SRename.
Since 2.900:
Added the COMMENT selector to allow the modification of filename comments
and the TOCOMMENT and TOFILENAME keywords to manage the redirection of the
resulting filename or comment.
Since 2.850:
Removed the APPEND and FROMEND keywords to simplify the command interface.
Their function is now performed by giving negative values to the AT and WORD
keywords respectively.
Note that the value that AT receives is now higher by 1. For example instead
of giving AT 0 to place a string at the beginning of a filename, you should
now give AT 1 to do that.
Also gone is the limitation that wouldn't allow the insertion of a string at
the end of a filename with normal insertion, that is by not using the append
mode (AT with negative values).
For example:
APPEND is replaced by AT -1
AT 2 APPEND is replaced by AT -2
WORD 1 FROMEND is replaced by WORD -1
Since 2.710:
Single character mode is now automatically activated if the string given after
MATCH consists of only one character. This makes the colon ':' that indicates
single character mode unnecessary when matching only a single character.
Since 2.700:
LENGTH action removed. It can easily be replaced by MID <num> DELETE.
Added WORD selector, supported by FROMEND, INCLSEP and WSEP.
Since 2.540:
MATCH additions: multiple match string support, single character mode, and
character code mode.
DELCHARS was removed as it can be replaced by MATCH :<chars> DELETE.
SWAP now takes into account the PREFIX/MAIN/SUFFIX selectors, so that parts
other than just the extremest can be swapped.
Since 2.520:
The TO keyword is no longer needed to perform simple renaming, so you can now
type 'SRename oldname newname' to rename 'oldname' as 'newname'.
The FILENAME keyword was renamed as FROM (same as the original rename command).
Since 2.510:
ICONS option was added to automatically rename .info files in single or
multiple filename mode (not in wildcard mode).
Since 2.500:
New keywords:
- DO
- SKIP
- BEFORE
- AFTER
- REVMATCH
- AT
- APPEND
- UPDATE
- UPTO
Removed keywords:
- DELBASE (is replaced by BASENAME "")
Additional parameters were removed from keywords:
- MATCH (moved to DO, SKIP, BEFORE, AFTER, REVMATCH)
- INSERT (moved to AT, APPEND)
- RENUMBER (moved to UPTO)
Other changes:
LEFT-RIGHT is not used anymore to set the position of the number within the
basename in renumbering mode. Instead the AT and APPEND keywords are used for
that purpose.
The following keywords now have different full names:
- PRE is PREFIX
- SUF is SUFFIX
- LEN is LENGTH
The following keywords now have abbreviations:
- PREFIX (PR)
- MAIN (MA)
- SUFFIX (SU)
- LEFT (L)
- MID (M)
- RIGHT (R)
- QUIET (Q)
Read each function's description for details about it's syntax.
USAGE :
SRename FROM/A/M,TO=AS/K,RLEVEL=RL/N,SLEVEL=SL/N,DIRPAT=DP/K,ALLDIRS=AD/S,
RECURSE=RC/S,NODIRS=ND/S,NOFILES=NF/S,ICONS=IC/S,DOT/K,WSEP=WS/K,COMMENT=CO/S,
PREFIX=PR/S,MAIN=MA/S,SUFFIX=SU/S,WORD=WD/N,INCLSEP=IS/N,LEFT=L/K,MID=M/K,
RIGHT=R/K,MATCH=MT/K,DO/N,SKIP=SK/N,BEFORE=BF/S,AFTER=AF/S,REVMATCH=RM/S,
EXCLUDE=XC/S,EXIST=XS/S,CASESENS=CS/S,TOFILENAME=TF/S,TOCOMMENT=TC/S,
UPPER=UP/S,LOWER=LW/S,UPAFTERSPC=US/S,INSERT=IN/K,AT/N,UPDATE=UD/S,DELETE=DL/S,
SWAP=SW/S,LSHIFT=LS/S,RSHIFT=RS/S,UNIFY=UN/S,CONV8+3=8+3/S,RENUMBER=RN/K,
UPTO=UT/N,STEP=ST/N,PLACES=PL/N,INVERT=IV/S,BASENAME=BN/K,PREFIRST=PF/S,
NODIROUT=NDO/S,QUIET=Q/S:
Short description of keywords :
FROM <string(s)> : filename(s) to rename
TO <string> : new string that replaces the selected characters,
and/or destination path
RLEVEL <number> : set the maximum level of recursion
SLEVEL <number> : set the starting level of recursion
DIRPAT <string> : match pattern for entering directories
ALLDIRS : make the DIRPAT pattern be used and beyond the
starting level of recursion
RECURSE : set full recursion
NODIRS : no directories are renamed
NOFILES : no files are renamed
ICONS : rename .info files automatically
DOT <character> : set the separator of prefix,main,suffix
WSEP <character(s)> : set the separator of words
COMMENT : select the comment of the filename
PREFIX : select the prefix
MAIN : select the main part
SUFFIX : select the suffix
WORD <number>,[<number>] : select the specified word
INCLSEP <number> : also select the word's separating chars
LEFT <number>,[<number>] : select characters from the left
MID [<number>],[<number>] : select characters in the middle
RIGHT <number>,[<number>] : select characters from the right
MATCH <string> : select the part that matches the string
DO <number> : number of matches to perform
SKIP <number> : number of matches to skip before starting
BEFORE : select the characters before the matched string
AFTER : select the characters after the matched string
REVMATCH : look for matches from the end of the filename
EXCLUDE : invert the selection process
EXIST : select a filename component only if it exists
CASESENS : enable case-sensitive matching
TOFILENAME : redirect the result to the filename
TOCOMMENT : redirect the result to the comment
UPPER : make the selected characters uppercase
LOWER : make the selected characters lowercase
UPAFTERSPC : make uppercase the character after a space
INSERT <string> : insert a string into the filename
AT <number> : set the position for the string to insert
UPDATE : insert a string only if it does not exist in the
specified position
DELETE : delete the selected characters
SWAP : swap the selected segments
LSHIFT : shift filename segments to the left
RSHIFT : shift filename segments to the right
UNIFY : unify the selected segments
CONV8+3 : convert to MS-DOS filename format
RENUMBER <number> : renumber a filename sequence to start with the
given number
UPTO <number> : renumber up to that number
STEP <number> : set the renumber step value
PLACES <number> : set the renumber number-format
INVERT : perform inverted renumbering
BASENAME <string> : set the renumber basename
PREFIRST : set the prefix segment first
NODIROUT : no directory name output
QUIET : no output at all
A detailed description of the above keywords can be found below. Most keywords
have an abbreviation which is the one in parentheses after their full name.
*******************************************************************************
FILE/DIR SELECTORS:
*******************************************************************************
The following keywords define which files or directories will be renamed,
according to their name, file or dir type, directory tree level, and the
directory name that are in.
FROM <filename(s)> :
The given file(s) or dir(s) are renamed. If just a directory or volume is
supplied, all its files are renamed. If instead of a filename, a pattern
(wild-card) is given, only files or dirs that match this pattern will be
renamed.
Multiple patterns can be supplied. Note that you don't actually have to type
'FROM' in the command line.
Examples:
> SRename C LW : Make C lowercase regardless of type (file or dir)
> SRename C/ LW : Make all files and dirs in C lowercase
> SRename C:d* UP : Make all files and dirs in C that begin with 'd' uppercase
-------------------------------------------------------------------------------
RLEVEL (RL) <recursion level value> :
Sets the level of recursion. If this is 1, only subdirectories in the current
directory will be entered.
The default recursion level is 0 (no recursion).
Example:
> SRename SYS:Games/a* LW RL 3 : Make all files in SYS:Games that begin with
'a' and in subdirectories up to 3 levels deep lowercase.
-------------------------------------------------------------------------------
SLEVEL (SL) <starting level value> :
Sets the starting level of recursion. Files and directories in a tree level
lower than the specified will not be entered. Also sets full recursion if a
RLEVEL parameter is not given. The default starting level is 1.
Note that the value of SLEVEL can not be greater than the value of RLEVEL.
Example:
> SRename SYS: UP SL 2 : Make all filenames in SYS: uppercase, except for the
filenames in the root directory.
-------------------------------------------------------------------------------
RECURSE (RC) :
Sets full recursion. All directories in the directory tree will be entered.
It is overridden by RLEVEL and can also be set by ALLDIRS.
Example:
> SRename SYS:Games/a* LW RC : Make all files in SYS:Games that begin with 'a'
lowercase in all subdirectories.
-------------------------------------------------------------------------------
DIRPAT (DP) <wildcard pattern> :
Determines which directories in a given path are to be entered to rename their
contents according to the specified pattern.
This parameter implies that recursion is active, if not it sets the level of
recursion to 1.
Note that the DIRPAT pattern is used only once for the directories that exist
in the directory that renaming begins.
If you want the DIRPAT pattern to be used all the way when recursing you must
give the ALLDIRS keyword.
Examples:
> SRename SYS:Data/*z DP project* DL SU : Remove the suffix from all the
filenames in SYS:Data that end with 'z' and from the filenames in the
subdirectories of SYS:Data that begin with 'project'.
> SRename SYS:Data/*z DP project* DL SU RC : Same as the previous example but
acts on filenames in all subdirectories that are contained in directories that
begin with 'project'.
-------------------------------------------------------------------------------
ALLDIRS (AD) :
Makes the DIRPAT pattern be used with all directories that are encountered,
not just with those in the starting level. A directory is entered for renaming
to take place, only if it matches the DIRPAT pattern.
ALLDIRS sets full recursion if a RLEVEL parameter is not given.
Examples:
> SRename SYS:Data/*z DP project* DL SU AD : Remove the suffix from all
the filenames in SYS:Data that end with 'z' and in all subdirectories of
SYS:Data that begin with 'project'.
> SRename SYS:Data/*z DP project* DL SU RL 2 : same as the previous
example but only acts on subdirectories of SYS:Data that begin with 'project'
in a depth of up to 2 levels.
-------------------------------------------------------------------------------
NODIRS (ND) :
Do not rename any directories. Only files are renamed.
Example:
> SRename Work/Data/ UP ND : Make all the filenames in Work/Data uppercase.
Directory names are not renamed.
-------------------------------------------------------------------------------
NOFILES (NF) :
Do not rename any files. Only directories are renamed.
Example:
> SRename Work/Data LW NF : Make all the dirnames in Work/Data lowercase.
Filenames are not renamed.
Note: if both NODIRS and NOFILES are given, only NODIRS will remain active.
-------------------------------------------------------------------------------
ICONS (IC) :
When in single or multiple filename mode or in renumbering mode the icon files
(.info files) are renamed automatically even if they weren't specified in the
filename list.
Note that the way this option works is that the icon gets exactly the same
filename that was given to the file that the icon accompanies.
The icon's filename itself is not taken into account.
If the file of the accompanying icon couldn't be found then the icon's filename
will not be modified.
As of this version ICONS can also be used with wildcards. When this happens
the wildcard pattern is modified so that it will exclude icon filenames so that
icon filenames will not be modified twice.
Examples:
> SRename tools/lacer tools/prepcard UP IC : Make 'lacer' and 'prepcard'
uppercase including their icons' filenames.
output:
"lacer" renamed as "LACER"
"lacer.info" renamed as "LACER.info"
"prepcard" renamed as "PREPCARD"
"prepcard.info" renamed as "PREPCARD.info"
>SRename tools/p#? UP IC : Make all filenames starting with 'p' and their
icons' filenames uppercase.
output:
"PrintFiles" renamed as "PRINTFILES"
"PrintFiles.info" renamed as "PRINTFILES.info"
"PrepCard" renamed as "PREPCARD"
"PrepCard.info" renamed as "PREPCARD.info"
>SRename picture1 RN 10 IC : Renumber files from picture1 and up, including
their icons.
output:
"picture1" renamed as "picture10"
"picture1.info" renamed as "picture10.info"
"picture2" renamed as "picture11"
"picture2.info" renamed as "picture11.info"
"picture3" renamed as "picture12"
"picture3.info" renamed as "picture12.info"
....
-------------------------------------------------------------------------------
COMMENT (CO) :
This is a special selector that makes SRename select the filename's comment
for modification instead of the filename itself.
All the other selectors and actions can then be applied to the comment and the
result of the modification will go to the filename's comment unless it is
redirected by the TOFILENAME keyword.
None of the renumbering actions however can be used with COMMENT.
Using COMMENT with such an action will be the same as using the TOCOMMENT
keyword. (see below)
Examples:
>SRename pic.iff CO UP : Make the comment of 'pic.iff' uppercase.
output:
Comment of "pic.iff" changed from "created with lightwave" to "CREATED WITH
LIGHTWAVE"
>SRename Data:pics/ CO DL : Delete all the comments from the filenames in the
'Data:pics/' directory.
>SRename roms/ CO MT "MAME" TO "M.A.M.E." : Replace all occurences of 'MAME'
in the comments of the filenames in 'roms' with 'M.A.M.E.'
*******************************************************************************
REDIRECTION KEYWORDS
*******************************************************************************
TOFILENAME (TF) :
This keyword is implied when performing filename renaming. It's main purpose
is to redirect the modified or unmodified comment to the filename instead.
If the user wants the current comment to be modified as well as the filename
then the TOCOMMENT keyword must also be given.
If a filename's comment contains characters that denote a path then only the
filename part of the comment will go to the filename.
Examples:
>SRename sample.iff CO TF : 'sample.iff' will be renamed as it's comment.
output:
"sample.iff" renamed as "created with SFX"
>SRename sample.iff CO UP TF TC : Makes the comment of 'sample.iff' uppercase
and will also use it to rename 'sample.iff'.
output:
Comment of "sample.iff" changed from "created with SFX" to "CREATED WITH SFX"
"sample.iff" renamed as "CREATED WITH SFX"
-------------------------------------------------------------------------------
TOCOMMENT (TC) :
This keyword is implied when modifying filename comments. It's main purpose is
to redirect the modified or unmodified filename to the comment instead.
If the user wants the filename to be modified as well as the comment then the
TOFILENAME keyword must also be given.
Note that when both TOFILENAME and TOCOMMENT are given with the ICONS keyword
then only the filenames of icons is modified and not their comments.
Files other than icons will get both their filename and comment modified in
such a case.
Examples:
>SRename brush1.bsh SU TO iff TF TC : Puts 'iff' to the filename suffix and
also copies the new filename to the comment.
output:
Comment of "brush1.bsh" changed from "" to "brush1.iff"
"brush1.bsh" renamed as "brush1.iff"
>SRename brush1.bsh TC : Copies the filename to the comment.
output:
Comment of "brush1.bsh" changed from "" to "brush1.bsh"
*******************************************************************************
CHARACTER SELECTORS: (in order of evaluation)
*******************************************************************************
The following keywords define which parts of the filename will be affected by
the action keywords that will follow. The selection can be done according to
the position of the characters or the characters themselves.
PREFIX (PR) :
Select the prefix (leftmost part) for modification.
MAIN (MA) :
Select the main part (middle part) for modification.
SUFFIX (SU) :
Select the suffix (rightmost part) for modification.
Specifying one of the above selectors does not cancel the others. Note that
if SRename receives a filename with only two components it regards that the
filename has no prefix.
The prefix component is filled only if the filename has 3 or more components,
or with 2 components if PREFIRST is specified, which forces prefix-main to be
filled instead of main-suffix.
Here are some examples on how different filenames fill the PREFIX-MAIN-SUFFIX
components:
Filename PREFIX MAIN SUFFIX
---------------- -------- -------- --------
test : -empty- test -empty-
001.test.pic.gif : 001 test.pic gif
test.pic.gif : test pic gif
001.test : -empty- 001 test
001.test PREFIRST : 001 test -empty-
Examples:
> SRename Work:#? SU ilbm XS : Replaces the contents of the suffix of
every filename in Work: with 'ilbm', if they have a suffix.
> SRename files/backup.lzx MA UP : Makes the main component uppercase.
output:
"backup.lzx" renamed as "BACKUP.lzx"
> SRename mod.techno PR UP PF : Forces PREFIX to be filled before SUFFIX and
makes the prefix uppercase.
output:
"mod.techno" renamed as "MOD.techno"
> SRename TheLastBallad.s3m SU UP : Makes the suffix uppercase.
output:
"TheLastBallad.s3m" renamed as "TheLastBallad.S3M"
-------------------------------------------------------------------------------
WORD (WD) <starting word number>,[number of words to select] :
Select a word within the filename. A word is determined by spaces by default,
unless the word separator is changed with the WSEP keyword.
Words are selected from the start of the filename unless the starting word
number is negative.
For example WORD -1 selects the last word of the filename.
If the second parameter is also given then consecutive words can be selected.
Note that WORD is evaluated after PREFIX/MAIN/SUFFIX and before MATCH and
LEFT/MID/RIGHT, so you can't select a filename part with MATCH or LEFT/MID/
RIGHT and then select a word within that part, but you can select a word
within PREFIX/MAIN/SUFFIX.
Examples:
> SRename "screen grab of game" WD 1 UP
output:
"screen grab of game" renamed as "SCREEN grab of game"
> SRename "Letter to john" WD -1 UP
output:
"Letter to john" renamed as "Letter to JOHN"
> SRename "screen grab of game" WD 1,2 UP
output:
"screen grab of game" renamed as "SCREEN GRAB of game"
> SRename Data:Pics/ MA WD 1 UP : Makes uppercase the first word in the main
part of the filename.
> SRename Data:Pics/ MA WD 1 L 1 UP : Makes uppercase the first character of
the first word in the main part of the filename.
-------------------------------------------------------------------------------
INCLSEP (IS) <number> :
Makes the WORD selector to include the separating characters that are left or
right of the word to select. The supplied number can be 1 or 2 and designates
what separating characters should be included.
1 means that the separating characters of only one side of the word will be
included: the right side. If there aren't any on the right side, then the
characters on the left side will be included.
2 means that the separating characters on both sides will be inluded, if they
exist.
This keyword has been included mainly to aid in the deleting of words.
Without INCLSEP the WORD selector will select the exact word that is told to,
and in case that word is to be deleted the spaces next to that word will remain.
For example:
> SRename "Bin:Picture of a ship" WD 3 DL
output:
"Picture of a ship" renamed as "Picture of ship"
As you see there are two spaces between 'of' and 'ship' instead of one that
would be normal. If you use INCLSEP 1 you will have:
> SRename "Bin:Picture of a ship" WD 3 IS 1 DL
output:
"Picture of a ship" renamed as "Picture of ship"
Now the WORD selector selects 'a ' instead of 'a' for deletion.
If you use INCLSEP 2 you will have:
> SRename "Bin:Picture of a ship" WD 3 IS 2 DL
output:
"Picture of a ship" renamed as "Picture ofship"
Now WORD selected ' a ' for deletion.
-------------------------------------------------------------------------------
WSEP (WS) <char(s)> :
Defines the word separator that will be used by the WORD selector to pick up
words. This is a space character by default.
This separator can be more than one character if this is really needed.
Example:
> SRename Letter_to_john WD 3 UP WS _
output:
"Letter_to_john" renamed as "Letter_to_JOHN"
-------------------------------------------------------------------------------
MATCH (MT) [:][/]<string(s)> :
Selects the characters that match the supplied string(s).
If the string to match is preceded by a colon ':' then single character mode
is activated and the supplied string is treated as individual characters.
This mode is now used to replace the DELCHARS action.
Example:
> SRename Pics/ MT :[]{}()<>#@ DELETE : Remove all []{}()<>#@ characters from
the filenames in Pics.
If the match string begins with a slash '/' then character code mode is
activated, and single or multiple comma separated ASCII codes or single
characters should follow.
Example:
> SRename Data/ MT /42,> DELETE : Remove all '*' and '>' characters from the
filenames in Data.
In this mode you can also select character ranges by supplying two characters
or their ASCII codes which should be separated by a minus sign '-', or just
the starting or ending character or ASCII code.
Note that if you want to specify a range that starts lower than 10, whatever
reason should you have to do that, then you must supply a leading zero before
the number so that it won't be a single character, as single characters supply
their ASCII value even if they are numeric ('0' gives ASCII code 48).
Examples:
> SRename Data/ MT /160-,48-57 DELETE : Remove all characters with ASCII codes
same as or greater than 160, and ASCII codes 48 to 57 (digit characters).
> SRename Data/ MT /-.,0-9,~- TO _ : Replace with '_' all characters before '.'
including it, from '0' to '9', and after '~' including it.
Note that BEFORE and AFTER have no effect in single character and character
code modes, and CASESENS has no effect in character code mode.
If none of the above modes are active then normal string matches are performed.
Multiple strings to match can be supplied by using '|' as a separator.
The matching is case-insensitive by default unless CASESENS is also given,
and the supplied string cannot be a wild-card.
The MATCH selector is very powerful and in conjunction with the DO, SKIP,
BEFORE, AFTER and REVMATCH keywords which are used only with MATCH and are
described below, and with the LEFT-MID-RIGHT selectors, it can select any part
of the filename relative to the matched string.
Using BEFORE or AFTER complicates things a bit for MATCH because selected
character ranges can overlap, and changes in one selected range can affect the
next selected range in the way that it will be selected and in the way it will
be modified.
To ensure that the intended characters by the user are selected, the MATCH
selector corrects both the selected character range length and position.
For example if two selected character ranges overlap, and new characters were
inserted within the overlapping range, then the length of the second character
range is adjusted so that all the intended characters are selected.
Examples:
> SRename SYS: MT pic TO picture : Replace all occurrences of 'pic' with
'picture' in all the filenames in the root dir of SYS:
> SRename Work: MT exe|lib UP : Make every occurrence of 'exe' and 'lib'
uppercase in all the filenames in the root dir of Work:
-------------------------------------------------------------------------------
DO <number of matches to perform> :
Determines the maximum number of matches that will be attempted by the MATCH
selector. The supplied numeric value should be at least 1, as a value of 0
will not result in making no matches.
Example:
> SRename -new-text-file MT - TO _ DO 2: Only the first 2 occurrences of '-'
will be replaced with '_'.
output:
"-new-text-file" renamed as "_new_text-file"
-------------------------------------------------------------------------------
SKIP (SK) <number of matches to skip> :
Determines the number of matches that will be skipped before any matches can
be performed.
Example:
> SRename -new-text-file MT - TO _ SK 1: Only the occurrences of '-' after the
first will be replaced.
output:
"-new-text-file" renamed as "-new_text_file"
-------------------------------------------------------------------------------
REVMATCH (RM) :
Makes the matching process to start from the end of the filename, instead of
the start.
Example:
> SRename -new-text-file MT - DO 1 RM : Only the last occurrence of '-' will be
replaced.
output:
"-new-text-file" renamed as "-new-text_file"
-------------------------------------------------------------------------------
BEFORE (BF) :
Selects the characters before the matched string. If you want to select a
limited amount of characters before a string, you should use the RIGHT selector.
Note that if you use BEFORE without RIGHT to select all characters before the
matched string, and start the match from the right with REVMATCH, only one
match will be performed, even if more than one strings to match exist.
Examples:
> SRename lastletter MT letter BF UP : Makes uppercase all characters before
'letter'.
output:
"lastletter" renamed as "LASTletter"
> SRename gamescreengrab MT grab BF R 6 UP : Makes uppercase 6 characters
before 'grab'.
output:
"gamescreengrab" renamed as "gameSCREENgrab"
-------------------------------------------------------------------------------
AFTER (AF) :
Selects the characters after the matched string. If you want to select a
limited amount of characters after a string, you should use the LEFT selector.
Note that if you use AFTER without LEFT and without REVMATCH to select all
characters after the matched string, only one match will be performed, even if
more than one strings to match exist.
Examples:
> SRename lastletter MT last AF UP : The characters after 'last' will be made
uppercase.
output:
"lastletter" renamed as "lastLETTER"
> SRename "the last ballad" MT " " AF L 1 UP : This is equivalent to uppercase
after space, with the exception that it does not uppercase the first character.
output:
"the last ballad" renamed as "the Last Ballad"
> SRename readmenow MT read AF L 3,2 UP : Makes uppercase 3 characters after
the end of 'read' plus 2 characters.
output:
"readmenow" renamed as "readmeNOW"
-------------------------------------------------------------------------------
LEFT (L) <number of chars>,[<left offset>] :
Select characters from the left side of the filename.
MID (M) [<left offset>],[<right offset>] :
Select characters using the distance from the left and right edge of the
filename.
RIGHT (R) <number of chars>,[<right offset>] :
Select characters from the right side of the filename.
Left/right offset specifies the number of characters from left/right to skip
before selecting the number of characters given in the first parameter.
Note that PREFIX/MAIN/SUFFIX are evaluated before LEFT/MID/RIGHT.
This means that you cannot for example select the 8 rightmost characters of a
file/dirname and then select the main component in them (if there is one).
For example: SRename newfilename.suf R 8 MA UP would not select the characters
'name' but would rather select the characters 'filename' as MAIN is evaluated
before RIGHT.
Also if more than one component of a filename is selected, any specified
actions will take place on the selected components separately.
For example: SRename 001.testpic.jpeg MA SU L 1 UP would make uppercase the
leftmost character in MAIN, and then in SUFFIX (001.Testpic.Jpeg) and not the
leftmost character of MAIN and SUFFIX combined (001.Testpic.jpeg).
Examples:
> SRename Libs:datatypes.library L 1 UP
output:
"datatypes.library" renamed as "Datatypes.library"
> SRename Work:001picture R 1,6 UP
output:
"001picture" renamed as "001Picture"
> SRename DataPartition_backup M 4,7 Volume
output:
"DataPartition_backup" renamed as "DataVolume_backup"
*******************************************************************************
OTHER KEYWORDS THAT AFFECT COMPONENT SELECTION:
*******************************************************************************
EXCLUDE (XC) :
Don't modify the selected characters but those that haven't been selected.
Note that it does not invert the selection that has been made by the PREFIX/
MAIN/SUFFIX selectors, and that it makes the exclusion after all the selectors
that have been given have acted.
If for example you have used the WORD and MATCH selectors and EXCLUDE, then
you can't exclude a part with WORD and then act on the excluded parts with
MATCH, because EXCLUDE will act after both WORD and MATCH will have selected
some parts of the filename.
Also note that when EXCLUDE is given with MATCH in single character or in
character code mode, then the parts that are excluded are modified as single
characters rather than as strings.
Examples:
> SRename asmallfile MT small UP XC
output:
"asmallfile" renamed as "AsmallFILE"
> SRename editorprefs L 6 UP XC
output:
"editorprefs" renamed as "editorPREFS"
-------------------------------------------------------------------------------
CASESENS (CS) :
Make string matching case-sensitive. The default is case insensitive.
This keyword can be used in conjunction with the MATCH selector,the UPDATE
action, and any of the renumbering actions.
Refer to these keywords for a detailed description.
Example:
> SRename FileNamewithname MT name TO Comment CS
output:
"FileNamewithname" renamed as "FileNamewithComment"
Note that only the second occurrence of 'name' is replaced with 'Comment'
because the string matching is case-sensitive.
-------------------------------------------------------------------------------
EXIST (XS) :
Modify the specified component (PREFIX-MAIN-SUFFIX) only if it exists.
Example:
> SRename SoundSample SU TO 8SVX XS
output: SoundSample not changed
A new suffix is not appended to the filename because it didn't have one in the
first place.
-------------------------------------------------------------------------------
DOT <character> :
Redefine the separator character. The default separator is a period (.)
The separator character determines the PREFIX-MAIN-SUFFIX components.
Example:
> SRename archive_tar_gz MA SU UP DOT _
output:
"archive_tar_gz" renamed as "archive_TAR_GZ"
*******************************************************************************
ACTION KEYWORDS:
*******************************************************************************
The following keywords define how the characters that have been selected with
the component selector keywords, will be modified.
TO (AS) <[path/]filename> :
Replaces the selected portion of the filename with the given string.
It can also be used to move files to other directories in the same volume
(AmigaOS Rename function limitation) if a path is supplied.
The 'TO' keyword need not be given if no other action keywords are supplied,
because in such a case the last given filename activates the 'TO' action.
That means that now SRename can perform simple renaming in the same manner
as the original Rename command:
> SRename oldfilename newfilename : 'oldfilename' is renamed as 'newfilename'.
If however you want for example to move a file to another directory and make
it uppercase, then you will have to use 'TO' as:
> SRename anyfile TO dirx/ UP : 'anyfile' is moved to 'dirx' and is made
uppercase.
If you omit 'TO' as: 'SRename anyfile dirx/ UP' ,that will tell SRename
to make uppercase 'anyfile' and all the filenames in the directory 'dirx'.
Note that the destination path is inherited from the source path (if it was
given) so that the destination path doesn't have to be supplied with the new
filename.
For example if the current dir is not 'SYS:Data', to rename 'letter.txt' with
the original Rename command you would type:
> Rename SYS:Data/letter.txt SYS:Data/NewFileName
With SRename you just type:
> SRename SYS:Data/letter.txt NewFileName.
Examples:
> SRename SYS:OldFileName L 3 New
output:
"OldFileName" renamed as "NewFileName"
> SRename SYS:OldFileName SYS:C/ : Moves OldFileName to C: maintaining its
filename.
> SRename SYS:OldFileName SYS:C/NewName : Moves OldFileName to C: and
renames it as 'NewName'.
-------------------------------------------------------------------------------
UPPER (UP) :
Makes the selected characters uppercase. It is Keymap sensitive so that it will
function correctly with any keymap-font setup.
Example:
> SRename Data/ L 1 UP : Makes uppercase the first character of every filename
in 'Data'.
> SRename Data/ SU UP : Makes uppercase only the suffix of every filename in
'Data'.
-------------------------------------------------------------------------------
LOWER (LW) :
Makes the selected characters lowercase. It is Keymap sensitive so that it will
function correctly with any keymap-font setup.
Example:
> SRename Data/TEXTFILE LW
output:
"TEXTFILE" renamed as "textfile"
-------------------------------------------------------------------------------
UPAFTERSPC (US) :
Makes characters after spaces uppercase. It also makes uppercase the first
character in the selected range.
Example:
> SRename "Data/text file" US
output:
"text file" renamed as "Text File"
-------------------------------------------------------------------------------
INSERT (IN) <string> :
Inserts the given string at the beginning of the selected characters.
You can make the insertion anywhere within the filename by using the AT
keyword.
Example:
> SRename Letter.txt IN First
output:
"Letter.txt" renamed as "FirstLetter.txt"
-------------------------------------------------------------------------------
AT <character position> :
Sets the position within the filename at which the string that was given with
INSERT is to be placed.
If the numeric value given with AT is negative then the character position is
measured from the right and not from the left. This is to allow AT to append
a string at the end of a filename.
Note that if the absolute value of the given character position is larger than
the length of the filename plus 1, then no insertion will take place.
For example: 'SRename afile IN name AT 7' will have no effect as no insertion
will be performed.
Also note that the AT keyword can also be used in renumbering mode to set the
position of the number within the basename.
Examples:
> SRename AnyFilename IN XYZ AT 4
output:
"AnyFilename" renamed as "AnyXYZFilename"
> SRename Sound IN Sample AT -1
output:
"Sound" renamed as "SoundSample"
> SRename Sound.iff IN Sample AT -5
output:
"Sound.iff" renamed as "SoundSample.iff"
-------------------------------------------------------------------------------
UPDATE (UD) :
Allows the INSERT action to proceed only if the string to insert does not exist
in the specified position.
The characters that are compared with the string to insert, are after the
specified position in insert mode and before the specified position in append
mode. The comparison is case-insensitive unless CASESENS is given.
Examples:
> SRename old_letter.txt IN Old UD : Because 'old' already exists in the
beginning of the filename it is not inserted.
output:
"old_letter.txt" not changed
> SRename old_letter.txt IN Old UD CS : Now 'Old' is inserted because the
comparison is case-sensitive.
output:
"old_letter.txt" renamed as "Oldold_letter.txt"
> SRename pic_last.iff IN Last AT 5 AP UD : Trying to insert 'last' 4 chars
from the end fails because it already exists.
output:
"pic_last.iff" not changed
-------------------------------------------------------------------------------
DELETE (DL) :
Removes the selected characters from the filename.
Examples:
> SRename SYS: L 3 DL : deletes the first 3 characters from filenames in SYS:
> SRename SYS: SU DL : deletes the suffix from filenames in SYS:
> SRename SYS: MT :#@ DL : deletes every '#' and '@' character from filenames
in SYS:
-------------------------------------------------------------------------------
SWAP (SW) :
Swaps the selected filename components. If 2 of the PREFIX,MAIN,SUFFIX
selectors are given, then the parts specified by these selectors will be
swapped. Otherwise if none of the above selectors are given, or just one, or
all of them, then just the 2 extremest components are swapped.
SWAP has an effect only on filenames with at least 2 components, like prefix-
main, main-suffix, or all (prefix-main-suffix).
Examples:
> SRename picture.iff SW
output:
"picture.iff" renamed as "iff.picture"
> SRename 001.picture.iff SW
output:
"001.picture.iff" renamed as "iff.picture.001"
> SRename 001.picture.iff PR MA SW
output:
"001.picture.iff" renamed as "picture.001.iff"
-------------------------------------------------------------------------------
LSHIFT (LS) :
Shifts the filename components to the left, the leftmost becomes the rightmost.
Like SWAP it has an effect only on filenames with at least 2 components.
This keyword operates on the whole filename, so the component selectors have
no effect with it.
Example:
> SRename SYS:001.picture.iff LS
output:
"001.picture.iff" renamed as "picture.iff.001"
-------------------------------------------------------------------------------
RSHIFT (RS) :
The opposite of LSHIFT. The rightmost component becomes the leftmost.
Example:
> SRename SYS:001.picture.iff RS
output:
"001.picture.iff" renamed as "iff.001.picture"
-------------------------------------------------------------------------------
UNIFY (UN) :
Unifies the filename components specified by PREFIX/MAIN/SUFFIX by deleting the
separator character. If no component is specified then it unifies the whole
filename.
Examples:
> SRename SYS:picture.001 UN
output:
"picture.001" renamed as "picture001"
> SRename SYS:001.picture.iff UN PR
output:
"001.picture.iff" renamed as "001picture.iff"
> SRename SYS:001.some.complex.name.iff UN MA
output:
"001.some.complex.name.iff" renamed as "001.somecomplexname.iff"
-------------------------------------------------------------------------------
CONV8+3 (8+3) :
Converts filenames to the MS DOS format of 8+3 characters. The filename will be
made uppercase, if it has a suffix this will be cut to 3 characters in length,
and if it has a prefix it will only be maintained if there is room left from
the main component.
Note that none of the selector keywords have any effect with this keyword,
because it always operates on the whole filename.
It is possible when converting whole directories that some filenames will fail
to be converted because they may get the same name with other files.
For example picture-1.iff and picture-2.iff will both receive the name:
PICTURE-.IFF
Examples:
> SRename SYS:User.prefs 8+3
output:
"User.prefs" renamed as "USER.PRE"
> SRename SYS:sound.sample.iff 8+3
output:
"sound.sample.iff" renamed as "S_SAMPLE.IFF"
*******************************************************************************
RENUMBERING:
*******************************************************************************
SRename can perform intelligent renumbering of filename sequences in one go.
It is not limited in the formats it can support, as it scans the filenames for
numbers of up to 9 digits long, which can have leading zeros, and can be in
any position in the filename, or on their own.
You don't have to specify the order of renaming, normal or reverse, as with
other renumbering utilities, because it scans the filenames in the directory and
decides which way to go.
Furthermore you don't have to worry for filename clashes during renumbering,
as any clashes will be found before the actual renaming begins, and the
clashing filenames will be given temporary names, before are finally renamed.
Inverting the numbers in a sequence can also be performed, a feature that would
be useful in compiling ping-pong animations.
The following keywords are relevant to renumbering and can be given all at
once, or on their own :
RENUMBER (RN) <new starting number> :
Specifies the new starting number of a filename sequence. All matching
filenames will be renumbered unless an ending number is specified with UPTO.
Examples:
> SRename Data:picture001 RN 50 : will renumber all filenames that begin with
'picture' and have a number attached at the end, to values starting with 50.
The leading zeros will be preserved.
output:
"picture001" renamed as "picture050"
"picture002" renamed as "picture051"
"picture003" renamed as "picture052"
"picture004" renamed as "picture053"
"picture005" renamed as "picture054"
....
> SRename Data:picture001 RN 50 UT 4 : as above but will renumber up to
filename 'picture004'.
output:
"picture001" renamed as "picture050"
"picture002" renamed as "picture051"
"picture003" renamed as "picture052"
"picture004" renamed as "picture053"
> SRename Data:10.frame RN 020 : will renumber all filenames that end in
'.frame' and are preceded with a value of 10 or greater, to values starting
with 020.
output:
"10.frame" renamed as "020.frame"
"11.frame" renamed as "021.frame"
"12.frame" renamed as "022.frame"
"13.frame" renamed as "023.frame"
"14.frame" renamed as "024.frame"
....
Note that when you supply a new starting number with leading zeros,
the old number format is overridden.
-------------------------------------------------------------------------------
UPTO (UT) <renumber up to this number> :
Specifies the existing number in a filename up to which SRename will perform
any of the renumbering actions.
If you give this keyword you must specify at least one renumber-type action
(RENUMBER,STEP,PLACES,BASENAME,AT,INVERT) with it, otherwise a 'Required
argument missing' error will occur.
Examples:
> SRename Data:picture001 RN 50 UT 6 : will renumber from 'picture001' up to
'picture006'.
> SRename Data:frame100 UT 110 BN AnimFrame : will change the basename to
'AnimFrame' from 'frame100' up to 'frame110'.
> SRename Pics/datafile0010 UT 20 PL 2 : will make 2-digit the numbers from
'datafile0010' up to 'datafile0020'.
-------------------------------------------------------------------------------
STEP (ST) <step value> :
Defines the increment value of renumbering. The default increment is 1.
It can also take negative values.
Examples:
> SRename Data:picture001 RN 30 ST 2 : increases the new starting value by 2.
output:
"picture001" renamed as "picture030"
"picture002" renamed as "picture032"
"picture003" renamed as "picture034"
"picture004" renamed as "picture036"
....
> SRename Data:picture001 ST 3 : will keep the original starting value, but
will increase the destination numbers in steps of 3 :
output:
"picture004" renamed as "picture010"
"picture003" renamed as "picture007"
"picture002" renamed as "picture004"
"picture001" not changed
....
Note that the renumbering is executed in reverse order in order to avoid a
clash when renaming picture002 to picture004 (picture004 already exists).
-------------------------------------------------------------------------------
PLACES (PL) <places value> :
Sets the number format of the destination filenames. This affects the number of
leading zeros the numbers will have.
If you specify a places value that is smaller than the digits a number already
has, that number will be unaffected. Any numbers will less digits than the
places value will be padded with leading zeros.
Examples:
> SRename Data:picture001 RN 30 PL 4 : makes the numbers 4-digit.
output:
"picture001" renamed as "picture0030"
"picture002" renamed as "picture0031"
"picture003" renamed as "picture0032"
"picture004" renamed as "picture0033"
....
> SRename Data:picture001 PL 1 : strips all leading zeros from the numbers.
output:
"picture001" renamed as "picture1"
"picture002" renamed as "picture2"
"picture003" renamed as "picture3"
"picture004" renamed as "picture4"
....
> SRename Data:picture001 UT 3 PL 2 : will renumber from number 001 to 003,
and make the numbers 2-digit.
output:
"picture001" renamed as "picture01"
"picture002" renamed as "picture02"
"picture003" renamed as "picture03"
-------------------------------------------------------------------------------
INVERT (IV) :
Invert the numbers in a filename sequence. This is exactly how inverting works:
original filenames new filenames
------------------ -------------
file.10 -> becomes -> file.14
file.11 -> becomes -> file.13
file.12 - not changed -
file.13 -> becomes -> file.11
file.14 -> becomes -> file.10
You may have noticed that executing this sequence of rename commands has a
problem: how can 'file.10' become 'file.14' when 'file.14' already exists.
SRename sees that and when destination filenames already exist, the files to
be renumbered are given temporary filenames until the existing filenames
themselves have been renumbered, so after this is done the temporary filenames
are given their normal destination filenames.
An unresolvable error occurs (New number exists) if these existing filenames
that cause clashes are not scheduled to be renumbered because they are outside
the range of files to be renumbered.
Examples:
> SRename Data:file100 IV : inverts the whole filename sequence.
output:
"file100" renamed as "109.srtemp861A5BC"
"file101" renamed as "108.srtemp861A5BC"
"file102" renamed as "107.srtemp861A5BC"
"file103" renamed as "106.srtemp861A5BC"
"file104" renamed as "105.srtemp861A5BC"
"file105" renamed as "file104"
"file106" renamed as "file103"
"file107" renamed as "file102"
"file108" renamed as "file101"
"file109" renamed as "file100"
"109.srtemp861A5BC" renamed as "file109"
"108.srtemp861A5BC" renamed as "file108"
"107.srtemp861A5BC" renamed as "file107"
"106.srtemp861A5BC" renamed as "file106"
"105.srtemp861A5BC" renamed as "file105"
Notice how numbers 100 to 104 are given temporary filenames before been finally
renumbered, because of clashes that would occur during the renaming process.
> SRename Data:file100 RN 50 IV : inverts the filename sequence and gives it
a starting number of 50.
output:
"file100" renamed as "file59"
"file101" renamed as "file58"
"file102" renamed as "file57"
"file103" renamed as "file56"
"file104" renamed as "file55"
"file105" renamed as "file54"
"file106" renamed as "file53"
"file107" renamed as "file52"
"file108" renamed as "file51"
"file109" renamed as "file50"
-------------------------------------------------------------------------------
BASENAME (BN) <basename string> :
Changes the filenames of a sequence but leaves the numbers that are attached
to each filename intact.
To delete the basename of a filename sequence, thus leaving only the numbers,
you should simply give: BASENAME ""
Examples:
> SRename Data:file100 BN picture : replaces 'file' with 'picture' in every
filename. Note that the number continues to be at the end of the new basename.
output:
"file100" renamed as "picture100"
"file101" renamed as "picture101"
"file102" renamed as "picture102"
"file103" renamed as "picture103"
....
> SRename Data:sound001.iff BN snd : will replace 'sound' with 'snd'.
output:
"sound001.iff" renamed as "snd001"
"sound002.iff" renamed as "snd002"
"sound003.iff" renamed as "snd003"
"sound004.iff" renamed as "snd004"
....
> SRename Data:file001pic RN 50 BN filepicture : will renumber starting at 50,
and replace 'filepic' with 'filepicture'. Note that the old number position
is preserved.
output:
"file001pic" renamed as "file50picture"
"file002pic" renamed as "file51picture"
"file003pic" renamed as "file52picture"
"file004pic" renamed as "file53picture"
....
> SRename Data:file001pic BN "" : will delete the basename.
output:
"file001pic" renamed as "001"
"file002pic" renamed as "002"
"file003pic" renamed as "003"
"file004pic" renamed as "004"
....
Note that when the number is surrounded by the basename, (the number is not
at the beginning or at the end) the position of the number within the basename
is preserved when a new basename is given.
This position can be changed with the use of the AT keyword as is explained
below.
-------------------------------------------------------------------------------
AT <position value> :
Sets the position of the number within the basename. It works in the same way as
with INSERT: positive values mean character position from the left and negative
values mean character position from the right.
Examples:
> SRename frame100.iff AT 1 : will move all numbers in the filename sequence
at the first character of the basename.
output:
"frame100.iff" renamed as "100frame.iff"
"frame101.iff" renamed as "101frame.iff"
"frame102.iff" renamed as "102frame.iff"
"frame103.iff" renamed as "103frame.iff"
....
> SRename 100frame.iff AT 6 : will move all numbers at the 6th character of
the basename.
output:
"100frame.iff" renamed as "frame100.iff"
"101frame.iff" renamed as "frame101.iff"
"102frame.iff" renamed as "frame102.iff"
"103frame.iff" renamed as "frame103.iff"
....
>SRename 100frame.iff AT -5 : all numbers will be moved at the 5th character
of the basename from the end.
output:
"100frame.iff" renamed as "frame100.iff"
"101frame.iff" renamed as "frame101.iff"
"102frame.iff" renamed as "frame102.iff"
"103frame.iff" renamed as "frame103.iff"
....
-------------------------------------------------------------------------------
CASESENS (CS) :
When in renumbering mode this keyword preserves each basename's casing.
If CASESENS is not given all basenames will get their content from the basename
of the first filename in the sequence, which is the default behaviour.
Example:
>SRename frame01 RN 20 CS
output:
"frame01" renamed as "frame20"
"FRAME02" renamed as "FRAME21"
"frame03" renamed as "frame22"
"FRAME04" renamed as "FRAME23"
"frame05" renamed as "frame24"
As you see the second and fourth basename remain in upper case.
*******************************************************************************
OTHER KEYWORDS:
*******************************************************************************
NODIROUT (NDO) :
Suppresses directory name output during recursion.
QUIET (Q) :
Suppresses all output including error messages.
-------------------------------------------------------------------------------
EMULATED FUNCTIONS :
You may think that SRename has some functions missing, like uppercase first
character, delete spaces, spaces to underscores, replace string1 with string2,
etc.
Such specialised functions can be built with other functions, for example:
Uppercase first can be performed with: LEFT 1 UP
Delete spaces with: MATCH " " DELETE
Spaces to underscores with: MATCH " " TO _
Replace string1 with string2 with: MATCH string1 TO string2
Even uppercase after space can be emulated with MATCH " " AFTER LEFT 1 UP, but
as the emulated function does not uppercase the first character too, I have
left the specialised function in.
PRIORITIES :
Not all keyword combinations make sense, that's why some keywords have priority
or cancel others. The following priorities exist:
LEFT has priority over MID which has priority over RIGHT
MATCH is evaluated before LEFT/MID/RIGHT
WORD is evaluated before MATCH
NODIRS cancels NOFILES
BEFORE cancels AFTER
RLEVEL has priority over RECURSE
DELETE cancels every other action
TO cancels every other action except DELETE
CONV8+3 cancels UPPER, LOWER and UPAFTERSPC
UPPER cancels LOWER and UPAFTERSPC
LSHIFT cancels RSHIFT
Any renumbering related action is cancelled by any other non-renumbering action.
TIPS:
When you use SRename with a filemanager like Directory Opus, and you have set
it up to receive multiple filenames ({O} option in DOpus), place that option
at the end of the command line, because if the filename sequence is too big
the arguments after it will be omitted. For example don't give DOpus the
command SRename {O} UP QUIET, but SRename UP QUIET {O}.
Since SRename has no way of knowing the maximum filename length that each
filesystem allows, care must be taken by the user not to supply longer
filenames than the filesystem can handle, so that filename clashes won't occur.
Although SRename can work with filenames that contain wildcard characters
(i.e. parentheses) and thus are recognised by the OS as file matching patterns,
it will only rename such filenames if it can find them immediately in the
supplied path.
It is not possible for example to specify such a filename and tell SRename to
recurse through the directory tree, renaming every occurrence of this filename,
if it does not find it in the starting directory, because once it can't find it
it will decide that it's a file-matching pattern, which is not what it was
intended for by you.
I advise that such filenames that confuse the OS and other applications are
not used.
Even if the command interface is 100% compatible with the original rename
command (version 37.2), SRename still differs in the way that it inherits
the destination path from the supplied source path.
For that reason I don't recommend that you replace the original Rename command
with SRename.
LIMITATIONS :
- Because of the way that the ReadArgs OS function works, you can not assign
different actions to different parts of the filename in one go, like for
example SRename anyfilename.suffix LEFT 3 UP SUFFIX DELETE.
The previous command will just delete the 3 leftmost characters from the
suffix (DELETE cancels UP).
This will change in the future.
- When recursing, it can go up to 255 directory levels deep.
- Recursing is cancelled if a destination path is given.
- The path of a file can't be longer than 1024 characters.
Limitations in Renumbering:
- Numbers in filenames from 0 to 999999999 can be handled.
- No wildcards can be used, and when a destination path is supplied no clash-
checking takes place (it is assumed that the destination directory contains
no filenames that can clash with the filenames that will be moved there).
- No filenames that contain wildcard characters can be used, because pattern-
matching is used to collect the filenames of the sequence.
- Any numbers that have a different format to that of the first number scanned
will not be renumbered: if the first number is 001 and 02,03 follow, these
will not be renumbered because SRename will expect to find 002 and 003.
- Selector keywords don't have any effect in renumbering mode.
- A filename clash can not be resolved if the clashing filename is outside the
range of filenames to be renumbered ('New number exists' error).
KNOWN BUGS :
SRename allows you to use long filenames even on filesystems that don't
support them (like FFS), so on such filesystems filenames longer than the
maximum allowed length (30 characters on FFS) will be trimmed by the
filesystem itself.
Similar behaviour can be expected for filename comments. SRename allows for
comments of up to 120 characters in length, but in the end the filesystem can
reject the comment if it's too long (up to 80 characters for FFS).
Although the MATCH selector performs length and position correction for the
selected character range, in case of overlapping ranges, actions that accept
position parameters are not corrected.
CREDITS :
Many thanks to Bill Duxbury and Fulvio Peruggi who have done beta-testing and
have reported bugs about SRename.
I also want to thank all the people who have contacted me about SRename.
If you have some suggestion, request, or bug report email me at:
cnicol@compulink.gr
or for snail-mail:
Constantinos Nicolakakis
Olympion 7 Patissia
11143 Athens, Greece